
m = int(input())
n = int(input())
t = []

for i in range(n):
    a = int(input())
    if 1 <= a <= m:
        print(t.append(a))
    else:
        continue
        t.sort()
        print(t)
